package com.moses.cityTraffic.utils

import org.apache.flink.api.common.state.MapStateDescriptor

// 样例类
// 从kafka中读取，车辆经过卡口的信息
case class TrafficInfo(actionTime: Long, monitorId: String, cameraId: String,
                       car: String, speed: Double, roadId: String, areaId: String)

// 卡口信息的样例类
case class MonitorInfo(monitorId: String, roadId: String, limitSpeed: Int, areaId: String)

// 车辆超速的信息
case class OutOfLimitSpeedInfo(car: String, monitorId: String, roadId: String,
                               realSpeed: Double, limitSpeed: Int, actionTime: Long)

case class AvgSpeedInfo(start: Long, end: Long, monitorId: String, avgSpeed: Double, carCount: Int)

object GlobalConstants {
  lazy val MONITOR_STATE_DESCRIPTOR = new MapStateDescriptor[String, MonitorInfo]("monitor_info", classOf[String], classOf[MonitorInfo])
}
